<template>
    <view :style="themeColor">
        <view class="page" >
    <view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex optionCity_flex_0"    :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
            <view   class='flex flex-wrap align-center justify-between optionCity_fd0_0'      >
            <view   class='flex flex-wrap align-center optionCity_fd0_0_c0'   @tap.stop="handleJumpDiy" data-type="back" data-url="1"   >
        <text class='fu-iconfont2  optionCity_fd0_0_c0_c0'  >&#xE794;</text>
</view>
    <view   class='flex flex-wrap align-center'      >
        <text class='optionCity_fd0_0_c1_c0'  >服务城市选择</text>
</view>
    <view   class='flex align-center justify-end optionCity_fd0_0_c0'      >
        </view>
</view>

        </view>
<view :style="{height: (88+StatusBarRpx)+'rpx'}"  ></view>
<!---flex布局flex布局开始-->
 <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout optionCity_flex_1"    >
            <benben-select-diy ref="showSelectPopup1692326281449" class-name='flex flex-direction align-stretch flex'  :items.sync="cityType" v-model="cityData.id" :label.sync="cityData.name" @change="throwFunc()" default-type="aid" default-label="name" :allow-cancel='false' type="radio" :disabled='false'  >
    <template v-for = '(item,key0) in cityType'>
            <view v-if="item.isSelected"  class='flex align-center justify-between flex optionCity_fd1_0_c0'  :key="key0" @tap="$refs.showSelectPopup1692326281449.tapHandle(key0)"     >
        <text class='flex-sub optionCity_fd1_0_c0_c0'  >{{item.name}}</text>
</view>    <view  v-else  class='flex align-center justify-between flex optionCity_fd1_0_c0'  :key="key0" @tap="$refs.showSelectPopup1692326281449.tapHandle(key0)"     >
        <text class='flex-sub optionCity_fd1_0_c0_c0'  >{{item.name}}</text>
</view></template></benben-select-diy>
</view>
        
<!---flex布局flex布局结束-->
    
    
        </view>
    </view>
</template>
<script>
    import {validate} from '@/common/utils/validate.js'
    
    export default {
        components:{},
        
        
        data(){
			return {"cityType":[],"city_id":"","cityData":{"id":"","name":""},"id":""};
		},
		computed:{
            themeColor() {
              return this.$store.getters.themeColor
            },
            
		},
		watch:{},
		onLoad(options){
            let {id}=options
if (id !== undefined) this.id = id
this.getCityFunc()
		},
        onUnload() {
                
        },
		onReady(){
            
		},
		onShow(){
            
		},
		onHide(){
            
		},
		onResize(){
            
		},
		onPullDownRefresh(){
            
		},
		onReachBottom(e){
            
		},
		onPageScroll(e){
            
		},
		methods:{
                            //获取城市
                async getCityFunc(){
                        //请求方法
    //数据验证
    
  let datacityType = await this.$api.get(global.apiUrls.post6544b2f60bf40, {
    aid:this.id
  });
  
  if (datacityType.data.code != 1) {
    this.$message.info(datacityType.data.msg);
    return
  } 
  let infocityType = datacityType.data;
  this.cityType = infocityType.data
  
                },
                //抛出事件
                 throwFunc(){
                                    uni.$emit('cityData',this.cityData)
            this.$urouter.navigateBack(1);
                }
		}
    };
</script> 
<style lang="scss" scoped>
           .page{
            width: 100vw;
            overflow-x: hidden;
            min-height: calc(100vh - var(--window-bottom));
            background:#fff;background-size: 100% auto;
        }
    .optionCity_flex_0{
        border-bottom:1px solid #eee;background:#fff;width:750rpx;height:88rpx;overflow:hidden;z-index:10;top:0rpx;background-size:100% auto !important;
    }
    .optionCity_fd0_0_c1_c0{
        font-size:36rpx;font-weight:500;color:#333333;
    }
    .optionCity_fd0_0_c0_c0{
        font-size:36rpx;color:#333;font-weight:500;
    }
    .optionCity_fd0_0_c0{
        width:120rpx;height:88rpx;
    }
    .optionCity_fd0_0{
        padding:0rpx 32rpx 0rpx 32rpx;height:88rpx;
    }
    .optionCity_flex_1{
        padding:0rpx 32rpx 0rpx 32rpx;
    }
    .optionCity_fd1_0_c0_c0{
        color:#333333;font-size:32rpx;font-weight:400;line-height:45rpx;margin:0rpx 24rpx 0rpx 0rpx;-webkit-line-clamp:1;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;
    }
    .optionCity_fd1_0_c0{
        border-bottom:1px solid #eee;padding:32rpx 0rpx 32rpx 0rpx;
    }
</style>